package com.aiwiown.face.request;

import com.aiwiown.face.ApiMethod;
import com.aiwiown.face.ApiObject;
import com.aiwiown.face.ApiRequest;
import com.aiwiown.face.internal.util.RequestParamUtils;
import com.aiwiown.face.response.FaceDetectResponse;
import com.aiwiown.face.response.FaceGestureResponse;

import java.util.Map;

/**
 * https://api-cn.faceplusplus.com/humanbodypp/v1/gesture
 * @ClassName : FaceGestureRequest
 * @Description :描述
 * 调用者提供图片文件或者图片URL，检测图片中出现的所有的手部，并返回其在图片中的矩形框位置与相应的手势含义。目前可以识别 19 种手势。
 * <p>
 * 识别出的手部位置会以一个矩形框表示。矩形框包含的范围从手腕到指尖。
 * <p>
 * 注意：本算法目前是专为移动设备自拍场景设计，在其他场景下对手势的识别精度可能不足。
 * @Author : dbin0123
 * @Date: 2020-06-13 14:27
 */
public class FaceGestureRequest implements ApiRequest<FaceGestureResponse> {

    private String apiVersion = "v1";
    private static String apiUrl = "/gesture";

    private String bizContent;
    private ApiObject bizModel = null;

    @Override
    public ApiMethod getApiMethod() {
        return ApiMethod.POST;
    }

    @Override
    public String getApiUrl() {
        return "/" + this.apiVersion + apiUrl;
    }

    @Override
    public Map<String, String> getTextParams() throws IllegalAccessException {
        return RequestParamUtils.getTextParams(this.bizModel);
    }

    @Override
    public Map<String, byte[]> getByteArrayParams() throws IllegalAccessException {
        return RequestParamUtils.getByteArrayParams(this.bizModel);
    }

    @Override
    public Class<FaceGestureResponse> getResponseClass() {
        return FaceGestureResponse.class;
    }

    @Override
    public String getApiVersion() {
        return this.apiVersion;
    }

    @Override
    public String getBizContent() {
        return this.bizContent;
    }

    public void setBizModel(ApiObject bizModel) {
        this.bizModel = bizModel;
    }

    @Override
    public String signVersion() {
        return null;
    }

    @Override
    public String getSignInfo(String apiKey, String secretKey) throws Exception {
        return null;
    }
}